//@ts-nocheck
import React, { useState } from 'react'
import { Pagination, Autoplay } from 'swiper'
import { Swiper, SwiperSlide } from 'swiper/react'
import './index.less'
import '../../../../node_modules/swiper/swiper.less'

const ImageTextComp = ({ images, startPlay }) => {
  const [isLoop, setIsLoop] = useState(images?.length > 1)
  return (
    <Swiper
      modules={[Pagination, Autoplay]}
      centeredSlides
      pagination={{ clickable: true }}
      autoplay={true}
      loop={isLoop}
    >
      {images?.map((img, index) => {
        return (
          <SwiperSlide key={index}>
            <img width="100%" src={img.resourceUrl} alt="" />
          </SwiperSlide>
        )
      })}
    </Swiper>
  )
}

export default ImageTextComp
